<?php

use Faker\Factory;
use Illuminate\Database\Seeder;

class CisOrgPositionTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //先清空表
        DB::table('wy_cis_org_position')->truncate();
        //实例化faker类
        $faker = Factory::create('zh_CN');//生成中文数据
        //循环
        for ($i = 1; $i <= 5; $i++) {
            DB::table('wy_cis_org_position')->insert([
                'name'        => '职位' . $faker->name,
                'valid_time'  => mt_rand(1, 5),
                'expire'      => date('Y-m-d H:i:s'),
                'bonus'       => mt_rand(100, 1000),
                'merchant_id' => mt_rand(1, 5),
                'status'      => mt_rand(0, 1),
                'created_at'  => date('Y-m-d H:i:s'),
            ]);
        }
    }
}
